-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Settings cleanup #1487
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Settings cleanup #1487
Conversation
|
| errorMessage.setAttribute("data-testid", "dialog-error-message") | ||
| errorMessage.textContent = "A profile with this name already exists" | ||
| errorMessage.className = "text-vscode-errorForeground text-sm mt-2" | ||
| dialogContent.appendChild(errorMessage) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Direct DOM manipulation (using appendChild to add error messages) in tests is not ideal. Consider simulating error states via component props or state updates so that tests remain declarative.
| jest.mock("../ProfileSwitcher", () => ({ | ||
| __esModule: true, | ||
| default: ({ currentApiConfigName }: any) => ( | ||
| <div data-testid="api-config-management"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updating the mock from ../ApiConfigManager to ../ProfileSwitcher is appropriate given the renaming. For clarity, consider updating related test IDs if the component’s name has changed in the DOM as well.
| <div data-testid="api-config-management"> | |
| <div data-testid="profile-switcher"> |
Context
Replace variations of select / dropdown with a @shadcn/ui
Selectcomponent that solves z-index issues.Implementation
Screenshots
How to Test
Get in Touch
Important
Refactor settings UI to use
@shadcn/uiSelectcomponent, rename files for clarity, and update tests accordingly.@shadcn/uiSelectcomponent inAdvancedSettings.tsx,BrowserSettings.tsx, andProviderSettings.tsx.ProviderSettingsto handle API configuration changes more effectively.ApiConfigManager.tsxtoProfileSwitcher.tsxandApiOptions.tsxtoProviderSettings.tsx.ChatView.tsx,TaskHeader.tsx, andModelPicker.tsx.Selectcomponent usage inProfileSwitcher.test.tsxandProviderSettings.test.tsx.index.cssto support new component styles.SettingsView.tsxto integrate new components.This description was created by
for 38e41c4. It will automatically update as commits are pushed.